import 'package:flutter/material.dart';

class DialogUtils {
  static showBGDialog(BuildContext context, {required child}) {
    showModalBottomSheet(
      context: context,
      isScrollControlled: true,
      backgroundColor: Colors.transparent,
      isDismissible: false,
      enableDrag: false,
      // 自定义蒙层颜色和透明度
      builder: (ctx) {
        return Stack(
          alignment: Alignment.bottomCenter,
          children: [
            GestureDetector(
              onTap: () {
                print("关闭====");
                Navigator.pop(context);
              },
              behavior: HitTestBehavior.opaque,
              child: const SizedBox(
                width: double.infinity,
                height: double.infinity,
              ),
            ),
            child,
          ],
        );
      },
    );
  }
}
